<?php
require_once '../classes/user.class.php';
if(session_id() == "") session_start();


if(isset($_SESSION['user'])) { 
			$id;
			if($_SESSION['user']->pseudo && $_SESSION['user']->pseudo!="")
				$id = $_SESSION['user']->pseudo;
			else 
				$id = $_SESSION['user']->mail;
                        
				
			echo "Salut ".$id." !&nbsp;&nbsp;&nbsp;|";
			echo "<span id=\"menu_item\" class='cursor item '  onClick='JavaScript: toggle_magicbar();'>Menu<span class=\"gbma\"></span></span>
            <div id=\"magicbar\" class='magicbar hidden'>
                <span style=\"font-weight: bold\">".$_SESSION['user']->getUsageName()."</span>
                <span style=\"color: #666666\">".$_SESSION['user']->getMail()."</span>
                <ol>";
                        if($_SESSION['user']->isAdmin()){
                            echo "<li><a href='index.php?page=manage'>Interface d'administration</a></li>";
                        }
                   
                   // <li>Paramètres de compte</li>
                   echo "<li class=\"deconnection\"><a href=\"#\" onClick='JavaScript: session_destroy();'>Déconnexion</a></li>
                </ol>
            </div>";
                        
                        
} else {
 	echo "<a href='php/login.php' rel='facebox' >S'identifier</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='php/create_account.php' rel='facebox' 
>Cr&eacute;er un compte</a>";
}
?>